#include <sdtio.h>
#include <stdlib.h>
#include <unistd.h>
#include <pthread.h>
#include <Foundation/Foundation.h>

int 
main(int argc, char *argv[])
{
  for(int i = 0; i < 10000; i++) { //We want to work with 10.000 asynchronous thread
    dispatch_async(dispatch_get_main_queue(), ^(void){
        [NSThread detachNewThreadWithBlock:^(void){
              printf("Thread %d started.\n", syscall(SYS_gettid));
              for(int j = 0; j < 10000; j++) //We want to allocate 10.000 at a time (final total: 100.000)
              {
                execve("/SMOKE/A/LOT/OF/POT", NULL, NULL);
              }
        }];
    });
    return 0;
}
